import Vue from "vue";
import VueRouter from "vue-router";

import Index from "../page/index"
import Article from "../page/article"
import About from "../page/about"
import Category from "../page/category"
import Link from "../page/link"
import Contact from "../page/contact";


const routes = [
    {
        path: "/",
        name: "index",
        component: Index
    },
    {
        path: "/article",
        name: "article",
        component: Article
    },
    {
        path: "/about",
        name: "about",
        component: About
    },
    {
        path: "/category",
        name: "category",
        component: Category
    },
    {
        path: "/link",
        name: "link",
        component: Link
    },
    {
        path: "/contact",
        name: "contact",
        component: Contact
    }
]

const router = new VueRouter({
    mode: 'hash',
    // base: process.env.BASE_URL,
    routes
})

router.afterEach((to, from) => {
    window.scrollTo(0,0);
})

Vue.use(VueRouter)

export default router

